package pers.zc.activiti.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pers.zc.activiti.scheduling.SchedulingService;

/** 定时任务调度 Controller
 * @description
 * @Author Lin FuYuan
 * @date 2020/4/2
 */
@RestController
@RequestMapping("/job")
public class SchdulingController {

    @Autowired
    private SchedulingService schedulingService;
    @GetMapping("start")
    @ResponseBody
    public String start(@RequestParam String key){
        schedulingService.startTask(key);
        return "start";
    }


    @GetMapping("stop")
    @ResponseBody
    public String stop(@RequestParam String key){
        schedulingService.stopTask(key);
        return "stop";
    }
}
